const _userInfo = [
  'username', 'password' // replece it with your own
]

chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) {
  if (msg === 'login') {
    const usernameInput = document.getElementById('username')
    const passwordInput = document.getElementById('password')
    const [username, password] = _userInfo
    usernameInput.value = username
    passwordInput.value = password
    
    const submitBtn = document.querySelector('input[type=submit]')
    submitBtn.click()
  }
  console.log('in the content js')
  sendResponse('done...')
})

console.log('content.js loaded')
